package kr.hkit.powerjava.chapter21;

import java.util.InputMismatchException;
import java.util.Scanner;

public class DivideByZero {
	public static void main(String[] args) {
		int x;
		int y;
		Scanner sc = new Scanner(System.in);
		int result = 0;
		
		try {
			System.out.println("피젯수 : ");
			x = sc.nextInt();
			System.out.println("젯수 : ");
			y = sc.nextInt();
			result = x / y;
		} catch (InputMismatchException e) {

			System.out.println("숫자만가능");
		} catch (ArithmeticException e) {
			System.out.println("0으로 나눌수 없다.");

		} finally {
			System.out.println("나눗셈 결과 : " + result);
		}

	}

}
